home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / surfsrc3.zip / MINMAX.INC < prev    next >
Text File  |  1991-09-25  |  1KB  |  36 lines

  1. procedure MINMAX (var Surfmin, Surfmax: surfaces; Nsurf: word);
  2. { Calculate the minimum and maximum Ztran coordinates of each surface }
  3.  
  4. var Surf: word;                      { surface # }
  5.     Vert: integer;                   { vertex # }
  6.     Zval: real;                      { Z-coord of node }
  7.  
  8. begin
  9. {$ifdef BIGMEM}
  10. with ptrf^ do with ptrh^ do
  11. begin
  12. {$endif}
  13.   Zmin := 9999.0;
  14.   Zmax := -9999.0;
  15.   for Surf := 1 to Nsurf do begin
  16.     Surfmin[Surf] := 9999.0;
  17.     Surfmax[Surf] := -9999.0;
  18.     for Vert := 1 to Nvert[Surf] do begin
  19.       Zval := Ztran[Konnec (Surf, Vert)];
  20.       if (Zval < Surfmin[Surf]) then
  21.         Surfmin[Surf] := Zval;
  22.       if (Zval > Surfmax[Surf]) then
  23.         Surfmax[Surf] := Zval;
  24.     end;
  25.     { KVC 08/18/91 Establish global limits on Z coordinate }
  26.     if ( Surfmin[Surf] < Zmin ) then
  27.       Zmin := Surfmin[Surf];
  28.     if ( Surfmax[Surf] > Zmax ) then
  29.       Zmax := Surfmax[Surf];
  30.   end;
  31. {$ifdef BIGMEM}
  32. end; {with}
  33. {$endif}
  34. end; { procedure MINMAX }
  35. 
  36.